#pragma once

//将任务放在数组中,父进程向管道中发送任务码，子进程执行相应下标的任务

#include<iostream>
#include<string>
#include<vector>
#include<functional>

using task_t = std::function<void()>;

void DownLoad()
{
    std::cout << "下载任务" <<std::endl;
}
void Mysql()
{
    std::cout << "MySql 任务"  << std::endl;
}
void Sync()
{
    std::cout << "Sync 任务" <<std::endl;
}
void Log()
{
    std::cout << "Log 任务" <<std::endl;
}

std::vector<task_t> tasks;

class Init
{
public:
    Init()
    {
        tasks.push_back(DownLoad);
        tasks.push_back(Mysql);
        tasks.push_back(Sync);
        tasks.push_back(Log);
    }
};

Init ginit;//全局的工具箱